<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>驾车导航</title>
    <!--引入Google Map JS文件，此处key＝“你申请道德key”-->
    <script type="text/javascript" src="http://ditu.google.cn/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAira30FR5tVprWCJ-8_WcqxSrc1zAT9YCtP2kOyoD7kBAJfliJBROJEdu9hUE13rp9a4OHneyOoW5gg"></script>

    <script type="text/javascript">
      
       var driveLine;
      //initMap()函数，将地图程序加入页面
      function initMap() {
        
        //GBrowserIsCompatible()确定Api能否兼容当前浏览器
        if (GBrowserIsCompatible()) {
          //在ID为"Gmap"的层内显示地图，设置加载搜索框
          var map = new GMap2(document.getElementById("Gmap"));    
          map.addControl(new GLargeMapControl());
          map.addControl(new GMapTypeControl());
          map.addControl(new GOverviewMapControl());
          map.addControl(new GScaleControl());

          //驾车导航
          driveLine = new GDirections(map);
          driveLine.load("from: 青岛 to: 烟台", { "locale": "zh-CN" });
      }       
    }
    </script>
  </head>
  <body onload="initMap()" onunload="GUnload()">
    <!--定义显示地图的层-->
    <div id="Gmap" style="width: 600px; height: 400px"></div>
  </body>
</html>
